package leetcode_1901_2000;

public class LeeCode_1925 {
    public static void main(String[] args) {
        System.out.println(countTriples(5));
    }
    private static int countTriples(int n) {
        int ans = 0;
        for (int i = 1; i < n; i++) {
            for (int j = i; j < n; j++) {
                for (int k = j; k <= n; k++) {
                    if (i * i + j * j == k * k){
                        ans += (i == j ? 1 : 2);
                    }
                }
            }
        }
        return ans;
    }
}
